package cn.wolfcode.mapper;

import cn.wolfcode.domain.Employee;
import cn.wolfcode.util.EmployeeQueryObject;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface EmployeeMapper {
    void deleteByPrimaryKey(Long id);

    void insert(Employee employee);

    Employee selectByPrimaryKey(Long id);

    List<Employee> selectAll();

    void updateByPrimaryKey(Employee employee);

    // 根据条件查询的数据集合
    List<Employee> queryForList(EmployeeQueryObject qo);

    // 保存单条员工跟角色的关联的sql
    void insertRelation(@Param("eId") Long eId, @Param("rId") Long rId);
    // 根据id删除员工所有的关联的sql
    void deleteRelation(Long eId);
    // 批量保存员工跟角色的关联的sql
    void insertAllRelation(@Param("eId") Long eId, @Param("ids") Long[] ids);
    // 查询用户
    Employee selectByUser(@Param("username") String username, @Param("password") String password);

    void batchDelete(Long[] ids);

    Employee selectByName(String name);
    // 修改密码
    void updateByPassword(Employee employee);

    List<Employee> selectByRoleSn(String... sns);
}